package com.kaifamiao.kfm.controller;

import com.kaifamiao.kfm.service.SysRoleService;
import com.kaifamiao.kfm.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@RestController
@RequestMapping("/role")
public class RoleController {

    @Autowired
    private SysRoleService sysRoleService;


    @GetMapping
    public ModelAndView index(){
        return new ModelAndView("role.html");
    }

    @GetMapping("/list")
    public JsonResult list(){
        return JsonResult.success("", sysRoleService.list());
    }
}
